package com.first.xiinn.action.web;

import java.util.List;

import javax.annotation.Resource;

import com.first.core.web.action.BaseAction;
import com.first.xiinn.model.Comment;
import com.first.xiinn.service.CommentService;
import com.opensymphony.xwork2.ActionContext;

public class IndexAction extends BaseAction {
	
	@Resource
	private CommentService commentService;
	
	//要跳转的地址 TODO 待修改为根据剪短的跳转描述字符，跳转到指定的地址（需要配置字符与地址的映射文件）
	private String path;
	
	private String id = null;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	private static final String USER_MENU_DOC = "_USER_MENU_DOC";

	public String execute() {
		List<Comment> comments = commentService.getNewestComments();
		setActionContextValue("comments", comments);
		return SUCCESS;
	}
	
	public String staticGoTo(){
		
		return SUCCESS;
	}
}
